package servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.CarDao;
import entity.CarInfo;

public class DeleteCarServlet extends HttpServlet {
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html; charset=UTF-8");
		
		
		int carid = Integer.parseInt(request.getParameter("carid")); 
		new CarDao().delete(carid);
		
		response.sendRedirect("/CarSystem/listCar");
		
		
	}

}
